package org.phantom.securityframework.api;

import java.util.List;

import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.UnknownAccountException;
import org.apache.shiro.subject.support.DelegatingSubject;

import org.phantom.securityframework.api.crypt.Encrypt;
import org.phantom.securityframework.api.domain.Group;
import org.phantom.securityframework.api.domain.Role;
import org.phantom.securityframework.api.exception.AccountNotActivatedException;
import org.phantom.securityframework.api.exception.NullAccountException;
import org.phantom.securityframework.api.subject.Subject;
/**
 * securityframework Account顶层接口
 * @author david
 *
 */
public interface Account extends Subject{

	public Integer getId();
	/**
	 * 获取帐号
	 * @return
	 */
	public String getAccountId();
	/**
	 * 获取密码
	 * @return
	 */
	public String getPassword();
	
	/**
	 * 获取帐号属性
	 * @return
	 */
	public List<AccountExt> getAccountExts();
	
	/**
	 * 获取帐号权限
	 * @return
	 */
	public List<Permission> getPermissions();
	/**
	 * 获取帐号角色
	 * @return
	 */
	public List<Role> getRoles();
	/**
	 * 获取帐号用户组
	 * @return
	 */
	public List<Group> getGroups();
	/**
	 * 获取帐号状态
	 * @return
	 */
	public Integer getStatus();
	
	
	
	

	public void setDelegate(DelegatingSubject subject);
	public void login()throws NullAccountException,UnknownAccountException,AccountNotActivatedException,AuthenticationException;
	public void login(Encrypt security)throws NullAccountException,UnknownAccountException,AccountNotActivatedException,AuthenticationException;
	public void login(String account,String password)throws NullAccountException,UnknownAccountException,AccountNotActivatedException,AuthenticationException;
	public void login(String account,String password,Encrypt security)throws NullAccountException,UnknownAccountException,AccountNotActivatedException,AuthenticationException;
	
}
